package com.shop.usercenter.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Entity //告诉JPA这是一个实体类（和数据表映射的类）
@Table(name = "sys_user") //@Table来指定和哪个数据表对应;如果省略默认表名就是user；
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "name", length = 64)
    private String name;
    @Column(name = "nickname", length = 64)
    private String nickname;
    @Column(name = "password", length = 64)
    private String password;
    @Column(name = "phone", length = 11)
    private String phone;
    @Column(name = "email", length = 64)
    private String email;
    @Column(name = "age", length = 64)
    private Integer age;
    @Column(name = "sex", length = 1)
    private Integer sex;
}
